package com.yaorange.controller;

import com.yaorange.api.Result;
import com.yaorange.entity.ArticleType;
import com.yaorange.service.ArticleTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @company: yaorange
 * @author: 啊啊啊林
 * @version: 1.0
 * @create: 2021-09-23 17:38:25
 */
@RestController
@RequestMapping("/articleType")
public class ArticleTypeController {
    @Autowired
    private ArticleTypeService articleTypeService;

    @GetMapping("/getAllType")
    public Result<?> findAllType() {
        List<ArticleType> all = articleTypeService.findAll();
        Result<List<ArticleType>> listResult = new Result<>();
        listResult.setData(all);
        listResult.setSuccess(true);
        return listResult;

    }

}
